package com.my.study.structures.linkedlist;

/**
 * @author Carlos
 * @version 1.0
 * @Description TODO
 * @date 2021/6/9 23:41
 **/
public class MergeDemo {

    public static void main(String[] args) {

        Node firstNode = new Node(1);
        Node n1 = new Node(3);
        Node n2 = new Node(5);
        firstNode.next = n1;
        n1.next = n2;


        Node secondNode = new Node(2);
        Node n4 = new Node(4);
        secondNode.next = n4;


        Node node = MergeLinked.mergeTwoList(firstNode, secondNode);

        Node temp = node;
        while (temp != null) {
            System.out.println(temp);
            temp = temp.next;
        }
    }

}
